/**
 * 
 */
package gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.FlowLayout;
import javax.swing.JButton;

import Controleur.ControleurGeneral;

/**
 * @author Tristan
 *
 */
public class ChoixFenetre extends FenetrePrincipale {

	/**
	 * 
	 */
	public ChoixFenetre(final ActionListener ctrl) {
		setTitle("Choisir");
		addWindowListener(new WindowListener() {
			@Override
			public void windowClosing(WindowEvent arg0) {
				ctrl.actionPerformed(new ActionEvent(this, 1, String.valueOf(ControleurGeneral.CLOSE_FENETRE_CHOIX)));
				
			}

			@Override
			public void windowActivated(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void windowClosed(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void windowDeactivated(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void windowDeiconified(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void windowIconified(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void windowOpened(WindowEvent e) {
				// TODO Auto-generated method stub
				
			}
		});
		afficher(ctrl);
	}

	/* (non-Javadoc)
	 * @see gui.FenetrePrincipale#afficher(java.awt.event.ActionListener)
	 */
	@Override
	public void afficher(ActionListener ctrl) {
		setBounds(100, 100, 262, 182);
		init();
		getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
		
		JButton btnReservation = new JButton("Effectuer une Reservation");
		getContentPane().add(btnReservation);
		btnReservation.addActionListener (ctrl);
		btnReservation.setActionCommand(String.valueOf(ControleurGeneral.DEMARRER_RESERVATION));
		
		JButton btnAssignerUnSejour = new JButton("Assigner un Sejour");
		getContentPane().add(btnAssignerUnSejour);
		btnAssignerUnSejour.addActionListener (ctrl);
		btnAssignerUnSejour.setActionCommand(String.valueOf(ControleurGeneral.DEMARRER_SEJOUR));
		
		JButton btnModifierUnSejour = new JButton("Modifier un Sejour");
		getContentPane().add(btnModifierUnSejour);
		btnModifierUnSejour.addActionListener (ctrl);
		btnModifierUnSejour.setActionCommand(String.valueOf(ControleurGeneral.DEMARRER_MODIFICATION_SEJOUR));
		
		JButton btnFacturerUnSejour = new JButton("Facturer un Sejour");
		getContentPane().add(btnFacturerUnSejour);
		btnFacturerUnSejour.addActionListener (ctrl);
		btnFacturerUnSejour.setActionCommand(String.valueOf(ControleurGeneral.DEMARRER_FACTURATION));
		
		setVisible(true);
	}
}
